package com.learn.mapstruct.afterMapping;

import com.learn.mapstruct.afterMapping.model.AfterMappingEntity1;
import com.learn.mapstruct.afterMapping.model.AfterMappingEntity2;
import com.learn.mapstruct.afterMapping.model.AfterMappingEntity3;
import org.mapstruct.*;

@Mapper
public interface BeforeAndAfterMappingMapper {

    AfterMappingEntity2 to(AfterMappingEntity1 entity1, @Context Object data);

    AfterMappingEntity3 to2(AfterMappingEntity1 entity1);

    @BeforeMapping
    default void beforeMapping(AfterMappingEntity1 entity1) {

    }

    @BeforeMapping
    default void beforeMapping2(AfterMappingEntity1 entity1, @Context Object data) {

    }

    @BeforeMapping
    default AfterMappingEntity2 beforeMapping3(AfterMappingEntity1 entity1, @Context Object data) {
        return null;
    }

    @AfterMapping
    default void afterMapping() {

    }

    @AfterMapping
    default void afterMapping2(Object anySource, @TargetType Class<?> targetType, @Context Object data) {

    }

    @AfterMapping
    default void afterMapping3(Object anySource, @MappingTarget Object target) {

    }

    @AfterMapping
    default void afterMapping4(Object anySource, @TargetType Class<?> targetType, @MappingTarget Object target) {

    }

    @AfterMapping
    default void afterMapping5() {

    }

    @AfterMapping
    default AfterMappingEntity3 afterMapping6() {
        return null;
    }
}
